#include <msp430g2203.h>

void ConfigWDT();
void ConfigIO();
void ConfigClocks();
void ConfigTimers();

void main(void)
{
	ConfigWDT();
	ConfigIO();
	ConfigClocks();
	ConfigTimers();
	while(1)
	{
		//Trap
	}
}

void ConfigWDT()
{
	WDTCTL = WDTPW + WDTHOLD;
}

void ConfigIO()
{
	P1DIR = 0x41;
}

void ConfigClocks()
{
	while(IFG1 & OFIFG)
	{
		P1OUT = 0x01;	
		IFG1 &= ~OFIFG;
		_delay_cycles(100);			//If red light stays lit, problem with crystal
	} 
	P1OUT = 0x00;
}

void ConfigTimers()
{
	TA0CTL = TASSEL_1 + MC_2;
}
